﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Model;
using DataAccess;

namespace Project
{
    /// <summary>
    /// Lógica de interacción para ViewFunctionaryContent.xaml
    /// </summary>
    public partial class ViewFunctionaryContent : UserControl
    {
        public ViewFunctionaryContent()
        {
            InitializeComponent();
        }

        public ViewFunctionaryContent(long CIEmpployee)
        {
            InitializeComponent();
            UIWindowManager.SetWindowTitle(this, "Brigada De Protección a la Familia - ViewFunctionary");
            Functionary empployee = new Functionary();
            empployee = DataBaseAccess.ReadEmployee(CIEmpployee);
            if (!empployee.Status)
            {
                label6.Visibility = Visibility.Hidden;
                JoinDatelb.Visibility = Visibility.Hidden;
            }
            Addresslb.Content = empployee.Address;
            BirthDatelb.Content = empployee.BirthDate.ToShortDateString();
            BirthPlacelb.Content = empployee.BirthPLace;
            BloodTypelb.Content = empployee.BloodType;
            CIlb.Content = empployee.CI.ToString();
            CivilStatuslb.Content = empployee.CivilStatus;
            Genderlb.Content = empployee.Gener;
            JoinDatelb.Content = empployee.JoinDate.ToShortDateString();
            if (!String.IsNullOrEmpty(empployee.MaternalName))
                MiddleNamelb.Content = empployee.MaternalName;
            FirstNamelb.Content = empployee.Name;
            LastNamelb.Content = empployee.PaternalName;
            Gradelb.Content = empployee.Rank;
            Chargelb.Content = empployee.WorkingRole;
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            UIWindowManager.CleanWindow(this);
        }
    }
}
